package hivi.vn.hivigold.objects;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class Item implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String VtID;
	private String VtName;
	private String Code;
	private String FK_DvtID;
	private String FK_Nhvt2ID;
	private String DienGiai;
	private Double Tlg_au;
	private Double Tlg_da;
	private Double Tong_tlg;
	private Double Tien_cong;
	private Double Tien_da;
	private Double Gia_au;
	private Double Gia_ban11;
	private Double Hlg_au;
	private String FK_QttgID;
	private Double Tien_da_nt;
	private String FK_TkID_dt;
	private String FK_TkID_gv;
	private String FK_TkID_tl;
	private String FK_TkID_vt;
	
	public Item()
	{
		
	}
	
	public Item(JSONObject json) {
		try {
			VtID = json.getString("VtID");
			VtName = json.getString("VtName");
			Code = json.getString("Code");
			FK_Nhvt2ID = json.getString("FK_Nhvt2ID");
			DienGiai = json.getString("DienGiai");
			Tlg_au = Double.parseDouble(json.getString("Tlg_au"));
			Tlg_da = Double.parseDouble(json.getString("Tlg_da"));
			Tong_tlg = Double.parseDouble(json.getString("Tong_tlg"));
			Tien_cong = Double.parseDouble(json.getString("Tien_cong"));
			Tien_da = Double.parseDouble(json.getString("Tien_da"));
			Gia_au = Double.parseDouble(json.getString("Gia_au"));
			Gia_ban11 = Double.parseDouble(json.getString("Gia_ban11"));
			Hlg_au = Double.parseDouble(json.getString("Hlg_au"));
			Tien_da_nt = Double.parseDouble(json.getString("Tien_da_nt"));
			setFK_QttgID(json.getString("FK_qttgID"));
			FK_DvtID = json.getString("FK_DvtID");
			FK_TkID_vt = json.getString("FK_TkID_vt");
			FK_TkID_dt = json.getString("FK_TkID_dt");
			FK_TkID_gv = json.getString("FK_TkID_gv");
			FK_TkID_tl = json.getString("FK_TkID_tl");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		
		try {
			JSONObject json = new JSONObject();
			json.put("VtID", getVtID());
			json.put("VtName", getVtName());
			json.put("FK_Nhvt2ID", getFK_Nhvt2ID());
			json.put("DienGiai", getDienGiai());
			json.put("Tlg_au", getTlg_au());
			json.put("Tlg_da", getTlg_da());
			json.put("Tong_tlg", getTong_tlg());
			json.put("Tien_cong", getTien_cong());
			json.put("Tien_da", getTien_da());
			json.put("Gia_au", getGia_au());
			json.put("Gia_ban11", getGia_ban11());
			json.put("Hlg_au", getHlg_au());
			json.put("FK_qttgID", getFK_QttgID());
			json.put("Tien_da_nt", getTien_da_nt());
			json.put("FK_DvtID", getFK_DvtID());
			json.put("FK_TkID_vt", getFK_TkID_vt());
			json.put("FK_TkID_dt", getFK_TkID_dt());
			json.put("FK_TkID_gv", getFK_TkID_gv());
			json.put("FK_TkID_tl", getFK_TkID_tl());
			return json.toString();
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return getVtID();
	}
	
	public String getVtID() {
		return VtID;
	}

	public void setVtID(String vtID) {
		VtID = vtID;
	}

	public String getVtName() {
		return VtName;
	}

	public void setVtName(String vtName) {
		VtName = vtName;
	}

	public String getFK_Nhvt2ID() {
		return FK_Nhvt2ID;
	}

	public void setFK_Nhvt2ID(String fK_Nhvt2ID) {
		FK_Nhvt2ID = fK_Nhvt2ID;
	}

	public String getDienGiai() {
		return DienGiai;
	}

	public void setDienGiai(String dienGiai) {
		DienGiai = dienGiai;
	}

	public Double getTlg_au() {
		return Tlg_au;
	}

	public void setTlg_au(Double tlg_au) {
		Tlg_au = tlg_au;
	}

	public Double getTlg_da() {
		return Tlg_da;
	}

	public void setTlg_da(Double tlg_da) {
		Tlg_da = tlg_da;
	}

	public Double getTong_tlg() {
		return Tong_tlg;
	}

	public void setTong_tlg(Double tong_tlg) {
		Tong_tlg = tong_tlg;
	}

	public Double getTien_cong() {
		return Tien_cong;
	}

	public void setTien_cong(Double tien_cong) {
		Tien_cong = tien_cong;
	}

	public Double getTien_da() {
		return Tien_da;
	}

	public void setTien_da(Double tien_da) {
		Tien_da = tien_da;
	}

	public Double getGia_au() {
		return Gia_au;
	}

	public void setGia_au(Double gia_au) {
		Gia_au = gia_au;
	}

	public Double getGia_ban11() {
		return Gia_ban11;
	}

	public void setGia_ban11(Double gia_ban11) {
		Gia_ban11 = gia_ban11;
	}

	public Double getHlg_au() {
		return Hlg_au;
	}

	public void setHlg_au(Double hlg_au) {
		Hlg_au = hlg_au;
	}

	public String getFK_QttgID() {
		return FK_QttgID;
	}

	public void setFK_QttgID(String fK_QttgID) {
		FK_QttgID = fK_QttgID;
	}

	public Double getTien_da_nt() {
		return Tien_da_nt;
	}

	public void setTien_da_nt(Double tien_da_nt) {
		Tien_da_nt = tien_da_nt;
	}

	public String getFK_DvtID() {
		return FK_DvtID;
	}

	public void setFK_DvtID(String fK_DvtID) {
		FK_DvtID = fK_DvtID;
	}

	public String getCode() {
		return Code;
	}

	public void setCode(String code) {
		Code = code;
	}

	public String getFK_TkID_dt() {
		return FK_TkID_dt;
	}

	public void setFK_TkID_dt(String fK_TkID_dt) {
		FK_TkID_dt = fK_TkID_dt;
	}

	public String getFK_TkID_gv() {
		return FK_TkID_gv;
	}

	public void setFK_TkID_gv(String fK_TkID_gv) {
		FK_TkID_gv = fK_TkID_gv;
	}

	public String getFK_TkID_tl() {
		return FK_TkID_tl;
	}

	public void setFK_TkID_tl(String fK_TkID_tl) {
		FK_TkID_tl = fK_TkID_tl;
	}

	public String getFK_TkID_vt() {
		return FK_TkID_vt;
	}

	public void setFK_TkID_vt(String fK_TkID_vt) {
		FK_TkID_vt = fK_TkID_vt;
	}
}
